/*******************************************
 * Copyright 2007 Aphrodite Framework for javaME .
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v2.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * Email : owner@aphroditeme.dev.java.net
 * Contributors:
 *     Kent Elton - initial API and implementation
 *******************************************/

package com.aphrodite.ui.schema;

/**
 * 
 * Schema for BitmapFontTable/Table widgets
 * 
 * 
 * @author kentelt
 * 
 */
public final class TableCell {
	/**
	 * Center indent cell text
	 */
	public final static byte INDENT_CENTER = 2;
	/**
	 * Left indent cell text
	 */
	public final static byte INDENT_LEFT = 1;
	/**
	 * Right indent cell text
	 */
	public final static byte INDENT_RIGHT = 3;
	/**
	 * Bold style
	 */
	public final static byte STYLE_BOLD = 1;
	/**
	 * Italic style
	 */
	public final static byte STYLE_ITALIC = 2;
	/**
	 * Plain style
	 */
	public final static byte STYLE_PLAIN = 0;

	/**
	 * Underlined style
	 */
	public final static byte STYLE_UNDERLINED = 4;
	public final String cellCaption;
	public int cellColor = 0xffffff;// white

	public byte columnSpan = 1;// single column
	public int fontColor = 0x000000;// black
	public byte fontStyle = 0;// plain
	public byte textIndent = 1;// left indent

	public TableCell(String caption) {
		// setCaption(caption);
		this.cellCaption = caption;
	}

	/**
	 * @param text
	 *            The cell text
	 * 
	 * @param colsSpan
	 *            Number of columns a merged or centered cell can span
	 * 
	 * @param rgbCellColorcell
	 *            color in hex
	 * @param rgbFontColor
	 *            font color in hex
	 * @param fontStyle
	 *            <br/>FontStyle - Font style for the cell<br/>
	 *            <ul>
	 *            <li>plain - 0</li>
	 *            <li>bold - 1</li>
	 *            <li>italic - 2</li>
	 *            <li>underlined - 4</li>
	 *            </ul>
	 *            OR based combinations like <b>bold|underline</b> etc is
	 *            allowed.
	 * @param textIndent
	 *            Text indentation<br/>
	 *            <ul>
	 *            <li>Left indent-1</li>
	 *            <li>Center -2</li>
	 *            <li>Right -3</li>
	 *            </ul>
	 */
	public TableCell(String text, byte colsSpan, int rgbCellColor, int rgbFontColor, byte fontStyle, byte textIndent) {
		this.columnSpan = colsSpan;
		// setCaption(text);
		this.cellCaption = text;
		this.cellColor = rgbCellColor;
		this.fontColor = rgbFontColor;
		this.fontStyle = fontStyle;
		this.textIndent = textIndent;
	}

	// public final byte getIndent() {
	// return textIndent;
	// }
	//
	// public final byte getColSpan() {
	// return colSpan;
	// }
	//
	// public final int getFontColor() {
	// return fontColor;
	// }
	//
	// public final byte getFontStyle() {
	// return fontStyle;
	// }
	//
	// public final String getCaption() {
	// return caption;
	//
	// }
	//
	// public void setIndent(byte indent) {
	// this.textIndent = indent;
	// }
	//
	// public void setFontStyle(byte style) {
	// this.fontStyle = (byte) (fontStyle | style);
	// }
	//
	// public final void setCaption(final String caption) {
	// this.caption = (caption != null) ? caption : "";
	// }
	//
	// public final int getCellColor() {
	// return cellColor;
	// }
	//
	// public final void setCellColor(final int cellColor) {
	// this.cellColor = cellColor;
	// }
	//
	// public final void setFontColor(int color) {
	// this.fontColor = color;
	// }

}
